<template>
    <el-carousel height="720px" :interval="3000" arrow="always">
      <el-carousel-item v-for="item in banner_list" :key="item.id">
        <a :href="item.link"><img :src="item.image_url" alt=""></a>
      </el-carousel-item>
  
      
  
    </el-carousel>
  
  </template>
  
  <script>
  export default {
    name: "BannerComp",
    data(){
      return {
        banner_list :[]
      }
    },
    created(){
      this.get_banner_list()
    },
    methods:{
      get_banner_list(){
        this.$axios.get(`${this.$settings.Host}/home/banner/`,{}).then(response =>{
          this.banner_list = response.data
          // console.log(response.data)
        })
      }
    }
  }
  </script>
  
  
  <style scoped>
  .el-carousel,
  .el-carousel__item {
    height: 690px; /* 高度固定为视口高度 */
  }
  
  .carousel-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin: 0;
    padding: 0;
  }
  </style>
  
  